﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Collections.Generic;
using System.Data.SqlClient;
using BTN04.DTO;
namespace BTN04.DAO
{
    public class TinhTrangNhaSanXuatDAO
    {
        public List<TinhTrangNhaSanXuatDTO> DanhSachTinhTrangNhaSanXuat()
        {
            List<TinhTrangNhaSanXuatDTO> _danhSach = new List<TinhTrangNhaSanXuatDTO>();
            string sql = "SELECT * FROM TinhTrangNhaSanXuat";
            SqlConnection cnn = new SqlConnection(DataProvider.ConnectionString);
            SqlCommand comand = new SqlCommand(sql, cnn);
            cnn.Open();
            SqlDataReader read = comand.ExecuteReader();
            while (read.Read())
            {
                TinhTrangNhaSanXuatDTO trnsxDTO = new TinhTrangNhaSanXuatDTO();
                trnsxDTO.MaTinhTrangNhaSanXuat = int.Parse(read["MaTinhTrangNhaSanXuat"].ToString());
                trnsxDTO.TenTinhTrangNhaSanXuat = read["TenTinhTrangNhaSanXuat"].ToString();
                _danhSach.Add(trnsxDTO);
            }
            return _danhSach;
        }
    }
}
